home *** CD-ROM | disk | FTP | other *** search
- /* Programm: PlayHifi_DT.dopus5
- ** $VER: PlayHifi_DT.dopus5 1.0 (25-Sep-95)
- **
- **
- ** Needed: Directory Opus V5.xx (© by Jonathan Potter & GPSoftware)
- ** mpega (© 1995 by Stephane Tavenard) or/and
- ** PeggyPlus MPEG-Card (© Ingenierbuero Helfrich)
- ** PeggyPlus:MPEGPlayer >= V4.7
- ** Play16 (© 1995 by Thomas Wenzel)
- ** PlayADPCM (Autor Christian Buchner)
- **
- ** Copyright © 1995 Eckhard Ludwig (Eckhard@top.east.de)
- ** PlayHifi_DT.dopus5 is freeware. It may be distributed freely.
- **
- ** Play compressed sound (MPEG Layer 1&2) from DOpus5. Only for DOpus5-filetypes,
- ** New: Play AIFF, WAVE, 8SVX, VOC, ADPCM3 (set filetypes doubleclick).
- **
- ** Localecatalog for german & more: used catalog "PlayHifi.dopus5" !
- **
- **
- ** Call as:
- ** --------------------------------------------------------------------------
- ** (Doubleklick) ARexx DOpus5:ARexx/PlayHifi_DT.dopus5 {f} {Qp} {Ql}
- ** --------------------------------------------------------------------------
- ** Set Attribut: "Output to window" (Ausgabe in Fenster).
- ** Set Attribut: "Run asynchron" (Asynchroner Start)
- **
- */
-
- /*- Path to Player command --------------------------------------------*/
- Play16 = "C:Play16"
- PlayADPCM = "C:PlayADPCM"
-
- /*- Path to MPEGPlayer command ----------------------------------------*/
- PlayMPEG = "C:mpega" /* Softwareplayer */
- MPEGA_OPTIONS=" -p -f0 -d2 -q2 " /* edit options for your system ! */
-
-
- parse arg '"' Titel '"' portname handle
-
- if portname='' then
- portname='DOPUS.1'
- address value portname
-
- options results
- options failat 21
- lf='0a'x
-
- Index = 'T:PlayDOpus5Index.temp' /*Name entspricht PlayHifi.dopus5 !*/
-
- if ~show('l','rexxsupport.library') then
- call addlib('rexxsupport.library',0,-30,0)
-
- /* init locale */
- if ~show(l,'locale.library') then
- call addlib('locale.library',0,-30)
- if show(l,'locale.library') then
- catalog=opencatalog('PlayHifi.catalog','english',0)
-
- if exists(Index) then do
- if ~delete(Index) then do
- Index=Index||'1'
- if exists(Index) then call open('output',Index,'A')
- else do
- if open('output',Index,'w') ~=1 then do
- dopus request '"'getcatstr(3,'Error:'lf'Load script in to editor and set path to Index !')'"' getcatstr(1,'Quit')
- exit
- end
- end
- APOS=lastpos("/",Titel)
- if APOS=0 then APOS=lastpos(":",Titel)
- songname=substr(Titel,APOS+1)
- lister query handle entry '"'songname'"' stem fileinfo.
- call writeln('output',Titel' @SIZE='fileinfo.size' @COMMENT='fileinfo.comment)
- call close('output')
- dopus front
- dopus request '"'getcatstr(14,'Songs added to playlist')'"' 'OK'
- exit
- end
- end
-
- dopus getfiletype '"'Titel'"' id
- DT=result
- if DT="MP2" then do
- if showlist("A","PEGGYPLUS")=1 then do
- if ~show('P','Peggy') then do
- address command 'stack 8192'
- address command 'RUN >NIL: <NIL: PEGGYPLUS:MPEGPlayer'
- address command 'waitforport Peggy'
- address value portname
- dopus front
- end
- end
- if show('P','Peggy') then do
- address 'Peggy'
- open '"'Titel'"'
- setwindow XOFF 0 YOFF 0 WIDTH 1 HEIGHT 1 XPIC 0 YPIC 0
- Play async
- end
- else do
- if ~exists(PlayMPEG) then do
- dopus front
- dopus request '"'getcatstr(9,'Error:'lf'MPEG-Player not found !'lf'path to command: '"'%s'"'',PlayMPEG)'"' getcatstr(1,'Quit')
- exit
- end
- address command PlayMPEG||MPEGA_OPTIONS||'"'Titel'"'
- end
- exit
- end
-
- if DT="ADPCM3" then do
- if ~exists(PlayADPCM) then do
- dopus front
- dopus request '"'getcatstr(10,'Error:'lf'ADPCM-Player not found !'lf'path to command: '"'%s'"'',PlayADPCM)'"' getcatstr(1,'Quit')
- end
- else address command PlayADPCM '"'Titel'"' " NOFILTER"
- exit
- end
-
- if ~exists(Play16) then do
- dopus front
- dopus request '"'getcatstr(11,'Error:'lf'Play16 not found !'lf'path to command: '"'%s'"'',Play16)'"' getcatstr(1,'Quit')
- exit
- end
- select
- when DT="CDR" then address command Play16 '"'Titel'"' " RAW FREQ=44100 TRACKS=2 BITS=16 INTEL FAST Paula14c FILTER=OFF VERBOSITY=1"
- when DT="WAVE" then address command Play16 '"'Titel'"' " FAST Paula14c FILTER=OFF VERBOSITY=1"
- when DT="AIFF" then address command Play16 '"'Titel'"' " FAST Paula14c FILTER=OFF VERBOSITY=1"
- otherwise address command Play16 '"'Titel'"' "FILTER=OFF VERBOSITY=1"
- end
- exit
-
- /*--------------------------------------------------------------------------------*/
- getcatstr:
- parse arg msgno,msgstring,insert.1,insert.2
- if catalog~=0 then msgstring=getcatalogstr(catalog,msgno,msgstring)
- j=0
- do while pos('%s',msgstring)>0
- parse var msgstring fore '%s' aft
- j=j+1
- msgstring=fore||insert.j||aft
- end
- return msgstring
-